#ifndef MAGICSQUARES_H
#define MAGICSQUARES_H

#include <stdio.h>
#include <stdlib.h>


/*
*
 * purpose: get the size of the desired magix square, must be odd integer
 * parameters: none
 * returns: returns the size if number is valid, -1 if number isn't valid
 * side-effects: none expected
 * sample-call: getSize() -> "5", returns 5
 */
int getSize();


/*
*
 * purpose: To construct the MagicSquares multidimentional array of size (n x n), where n is the inputed size
 * parameters: none
 * returns: a pointer to the multidimensional array
 * side-effects: if system is out of memory, program exits with exit value = 1
 * sample-call: produceTable(), (size = n), constructs n x n MagicSquare and returns it
 */
int** produceTable();


/*
*
 * purpose: Saves the Magic Square matrix to file magic-n.txt, where n = size
 * parameters: table the multi.dim. array to print to file, size is the size of the table
 * returns: 1 if file was opened and written too, 0 if file couldn't be opened
 * side-effects: none expected
 * sample-call: saveTable(magicbox,5), writes the 5x5 magixbox matrix to file magic-5.txt, if it can be opened, returns 1
 */
int saveTable(int** table, int size);


/*
*
 * purpose: starts the program, gets size from user, calls necessary functions to produce matrix, frees memory
 * parameters: none
 * returns: EXIT_SUCCESS if matrix is printed correctly and saved, EXIT_FAILURE if there was an error
 * side-effects: none expected
 * sample-call: gcc -pedantic-errors MagicSquares.c -> starts main() -> calls functions returns EXIT_SUCCESS if all goes well
 */
int main();

#endif

